import request from '@/utils/request'

const api_name = '/ucenter/code'

export default {
  // 获取邮件验证码
  sendMailCode(email) {
    return request({
      url: `${api_name}/mail`,
      method: 'get',
      params: { email }
    })
  },
  // 验证邮箱验证码试是否正确
  verifyEmailCode(code) {
    return request({
      url: `${api_name}/mail/code`,
      method: 'get',
      params: { code }
    })
  },
  // 获取短信验证码
  sendSmsCode(phone) {
    return request({
      url: `${api_name}/phone`,
      method: 'get',
      params: { phone }
    })
  },
  // 验证手机验证码试是否正确
  verifySmsCode(code) {
    return request({
      url: `${api_name}/phone/code`,
      method: 'get',
      params: { code }
    })
  }
}
